package com.maxdu.labs.stt.models;

import java.util.Date;

import com.maxdu.labs.stt.constants.FriendRequestConstants;
import com.maxdu.labs.stt.models.db.FriendRequestDBHelper;

public class FriendRequest {
	private String userSenderId;
	private String userReceiverId;
	private int accepted;
	private Date sentDate;
	private Date responseDate;
	
	public FriendRequest(String userSenderId, String userReceiverId){
		this.userSenderId = userSenderId;
		this.userReceiverId = userReceiverId;
		accepted = FriendRequestConstants.FRIEND_REQUEST_PENDING;
		sentDate = new Date();
		responseDate = null;
	}
	
	public FriendRequest(String userSenderId, String userReceiverId, int accepted, Date sentDate, Date responseDate){
		this.userSenderId = userSenderId;
		this.userReceiverId = userReceiverId;
		this.accepted = accepted;
		this.sentDate = sentDate;
		this.responseDate = responseDate;
	}
	
	public void saveToCloud(){
		FriendRequestDBHelper frDBHelper = new FriendRequestDBHelper();
		frDBHelper.saveToCloud(this);
	}
	
	/*
	public List<FriendRequest> getAwaitingForApproval(long userId){
		
	}*/

	public String getUserSenderId() {
		return userSenderId;
	}

	public void setUserSenderId(String userSenderId) {
		this.userSenderId = userSenderId;
	}

	public String getUserReceiverId() {
		return userReceiverId;
	}

	public void setUserReceiverId(String userReceiverId) {
		this.userReceiverId = userReceiverId;
	}

	public int getAccepted() {
		return accepted;
	}

	public void setAccepted(int accepted) {
		this.accepted = accepted;
	}

	public Date getSentDate() {
		return sentDate;
	}

	public void setSentDate(Date sentDate) {
		this.sentDate = sentDate;
	}

	public Date getResponseDate() {
		return responseDate;
	}

	public void setResponseDate(Date responseDate) {
		this.responseDate = responseDate;
	}
}
